package util;

import java.util.Arrays;

public class Main {
    public static void main1(String[] args) {
        MyClass obj1 = new MyClass();
        obj1.setNum(123);
        obj1.setName("Hello");
        obj1.setArray(new int[]{1, 2, 3});

        try {
            MyClass obj2 = ObjectCloner2.clone(obj1);
            System.out.println("obj1 " + obj1);  // 输出 "true"
            System.out.println("obj2 " + obj2);  // 输出 "true"
            System.out.println("obj1 != obj2 " + (obj1 != obj2));  // 输出 "true"
            System.out.println("obj1.getArray() != obj2.getArray() " + (obj1.getArray() != obj2.getArray()));  // 输出 "true"
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main4(String[] args) {
        Main main = new Main();
        int i = main.firstMissingPositive(new int[]{7,8,9,11,12});
        System.out.println(i);
    }

    int firstMissingPositive(int[] nums) {
        int ret = 0, count = 0;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] > 0){
                min = Math.min(min, nums[i]);
            } else {
                nums[i] = 0;
                count++;
            }
        }
        int sz = nums.length;
        for (int i = min; i <= min + sz-count; i++) {
            ret ^= i;
            if (i - min < sz) {
                ret ^= nums[i - min];
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        Stu stu = new Stu();
        Stu stu1 = new Stu();
        System.out.println(stu1.name == stu.name);
        int a = 6;
        System.out.println(Integer.valueOf(a) instanceof Integer);
        double b1 = -11.5, b2 = 11.5;
        System.out.println(Math.round(b1) + " " + Math.round(b2));
        System.out.println(Math.floor(b1) + " " + Math.floor(b2));
        System.out.println(Math.ceil(b1) + " " + Math.ceil(b2));
    }
}
class Stu{
    public String name = "abc";
}